//
// Created by wze-zero on 2024/10/21.
//
#include <iostream>

using namespace std;

void replace(char arr[], int num, char n, char m) {
    for (int i = 0; i < num; ++i) {
        if (arr[i] == n) {
            arr[i] = m;
        }
    }
}

int main() {
    int num;
    char a1, a2, a3, a4;
    cin >> num >> a1 >> a2 >> a3 >> a4;
    char a[num];
    cin >> a;
    replace(a, num, a1, a2);
    replace(a, num, a3, a4);
    cout << a << endl;
    return 0;
}